package com.xpqh.ksg.modular.core.controller;


import com.xpqh.ksg.base.BaseController;
import com.xpqh.ksg.base.BaseResponseDTO;
import com.xpqh.ksg.modular.core.dto.KsgHomePageByPcReqDTO;
import com.xpqh.ksg.modular.core.dto.KsgHomePageByPcRespDTO;
import com.xpqh.ksg.modular.core.dto.SeriesListReqDTO;
import com.xpqh.ksg.modular.core.service.CoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@RequestMapping(value = "ksg")
public class KsgHomePageByPcController extends BaseController {

    @Autowired
    private CoreService coreService;
    @PostMapping("/homePageByPc")
    public com.xpqh.ksg.base.BaseResponseDTO series(@Valid @RequestBody KsgHomePageByPcReqDTO req) {
        KsgHomePageByPcRespDTO respDTO = new KsgHomePageByPcRespDTO();
        respDTO.setCaseList(coreService.getCaseListC(req.getLanguage()));
        respDTO.setBannerList(coreService.getBannerList(req.getLanguage()));
        respDTO.setNewsList(coreService.getNewsListByHome());
        respDTO.setStoreList(coreService.getStoreInfoListByHome());
        return renderResultOk(respDTO);
    }
}
